//
//  EvaluationCell.m
//  一键车讯
//
//  Created by 江玉元 on 14/10/31.
//  Copyright (c) 2014年 lanou.3g.com. All rights reserved.
//

#import "EvaluationCell.h"
#import "Evaluation.h"
#import "UIImageView+WebCache.h"
@implementation EvaluationCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        self.Imageview = [[UIImageView alloc] init];
        [self.contentView addSubview:self.Imageview];
        [_Imageview release];
        
        self.titleLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.titleLabel];
        [_titleLabel release];
        
        self.countLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.countLabel];
        [_countLabel release];
        
        self.dateLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.dateLabel];
        [_dateLabel release];
    }
    return self;
}

- (void)setEvaluation:(Evaluation *)evaluation
{
    if (_evaluation != evaluation) {
        [_evaluation release];
        _evaluation = [evaluation retain];
    }
    [self.Imageview setImageWithURL:[NSURL URLWithString:self.evaluation.image]];
    self.titleLabel.text = self.evaluation.title;
    self.titleLabel.numberOfLines = 2;
    self.countLabel.text = self.evaluation.count;
    self.dateLabel.text = self.evaluation.date;
    
    self.Imageview.frame = CGRectMake(10, 10, 85, 60);
    self.titleLabel.frame = CGRectMake(105, 10, 195, 35);
    self.titleLabel.font = [UIFont systemFontOfSize:14];
    self.countLabel.frame = CGRectMake(105, 60, 80, 10);
    self.countLabel.font = [UIFont systemFontOfSize:12];
    [self.countLabel setTextColor:[UIColor grayColor]];
    
    self.dateLabel.frame = CGRectMake(245, 60, 80, 10);
    self.dateLabel.font = [UIFont systemFontOfSize:12];
    [self.dateLabel setTextColor:[UIColor grayColor]];
    
}

- (void)dealloc
{
    [_Imageview release];
    [_titleLabel release];
    [_countLabel release];
    [_dateLabel release];
    [super dealloc];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
